package net.lab1024.sa.admin.module.basedata.customer.controller;

import net.lab1024.sa.admin.module.basedata.customer.domain.entity.CustomerBank;
import net.lab1024.sa.admin.module.basedata.customer.service.CustomerBankService;
import net.lab1024.sa.base.common.domain.ResponseDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/customers/bank")
public class CustomerBankController {

    @Autowired
    private CustomerBankService customerBankService;

    @PostMapping("/saveOrUpdateCustomerBank")
    public ResponseDTO<Object> saveOrUpdateCustomerBank(@RequestBody List<CustomerBank> customerBankList) {
        customerBankService.saveOrUpdateCustomerBank(customerBankList);
        return ResponseDTO.ok();
    }

}
